package com.fly.uaa.service.impl;

import com.fly.common.model.UserEntity;
import com.fly.uaa.dao.LoginMapper;
import com.fly.uaa.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description 登录业务实现
 * @author: fly
 * @date: 2018/11/26 14:52
 */
@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    /**
     * 根据账户获取用户信息
     *
     * @param userName 账户
     * @return 用户信息
     */
    @Override
    public UserEntity queryUserByUserName(String userName) {
        return loginMapper.queryUserByUserName(userName);
    }

    /**
     * 根据主键获取用户信息
     *
     * @param userId 用户主键
     * @return 用户信息
     */
    @Override
    public UserEntity queryUserById(Long userId) {
        return loginMapper.selectById(userId);
    }
}
